<%--
  Created by IntelliJ IDEA.
  User: miao
  Date: 2022/11/10
  Time: 18:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
  <head>
    <title>用户信息界面</title>
      <link rel="stylesheet" type="text/css" href="css/page.css">
  </head>
  <body>
    <table border="1px">
      <caption>用户信息管理页</caption>
        <thead>
          <tr>
            <th>用户id</th>
            <th>用户名称</th>
            <th>密码</th>
<%--            <th>用户头像</th>--%>
            <th>操作</th>
          </tr>
        </thead>
      <tbody>
      <c:forEach items="${userInfoPage.list}" var="userInfo">
        <tr>
          <td>${userInfo.userId}</td>
          <td>${userInfo.userName}</td>
          <td>${userInfo.password}</td>
<%--          <td>${userInfo.pic}</td>--%>
<%--          <td><a href="">修改</a></td>--%>
          <td><a href="DeleteUserServlet?userId=${userInfo.userId}">删除</a></td>
        </tr>
      </c:forEach>
      </tbody>
      <tfoot>
        <div class="page">
          <a href="ViewUsersInfo">首页</a>
          <a href="ViewUsersInfo?num=${userInfoPage.prePageNum}">上一页</a>
          <a href="ViewUsersInfo?num=${userInfoPage.nextPageNum}">下一页</a>
          <a href="ViewUsersInfo?num=${userInfoPage.totalPageNum}">末页</a>
          <select id="pageSelect" name="pageSelect" onchange="changePage(this.value)">
            <c:forEach var="i" begin="1" end="${userInfoPage.totalPageNum}">
              <c:if test="${i == userInfoPage.currentPageNum }">
                <option value="${i }" selected="selected">第${i }页</option>
              </c:if>
            <c:if test="${i != userInfoPage.currentPageNum }">
              <option value="${i }">第${i }页</option>
            </c:if>
          </c:forEach>
        </select>
      </div>
      </tfoot>

      <script type="text/javascript">
        function changePage(page){
          window.location.href="ViewUsersInfo?num=" + page;
        }
      </script>
    </table>
  </body>
</html>






















